.table-thead {
    width: fit-content;
    /* 宽度由内容决定，即所有列宽之和 */
    max-width: 100%;
    display: flex;
    flex-direction: row;
    /* 垂直堆叠行 */
    box-shadow: inset 0 calc(-1px / var(--dpr)) 0 var(--color-border);

    will-change: transform;
    overflow: hidden;	
}

.header-column-container {
    display: flex;
    flex-direction: column;
    /* 垂直堆叠：上面是标题，下面是子列 */
    flex-shrink: 0;
    /* 右边框加在容器上 */
    box-sizing: border-box;
}


/* 🔥 新增：子列的横向容器 */
.header-children-row {
    display: flex;
    flex-direction: row;
    /* 子列横向排列 */
    width: 100%;
    flex: 1;
    /* 占满剩余高度 */
    box-shadow: 0 calc(-1px / var(--dpr)) 0 var(--color-border);
    /* 子容器顶部加边框，即父标题的底部 */
}

.table-th {
    display: flex;
    align-items: center; // 内容垂直居中
    min-width: 0;
    white-space: normal;
    overflow: hidden;
    box-sizing: border-box; // 🔥 统一盒模型
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
	position: relative;
	flex-shrink: 0; // 禁止 flex 压缩宽度，完全遵从 style width
	font-weight: 600;
	justify-content: var(--text-align, left);
}

.th-content {
    display: flex;
    align-items: center; // 内容垂直居中
    // justify-content: var(--text-align, left);
    gap: 4px;
}

.table--border .header-column-container {
    box-shadow: inset calc(-1px / var(--dpr)) 0 0 var(--color-border);

    &:last-child {
        box-shadow: none;
    }
}

.check-box-container {
    display: flex;
    align-items: center;
    justify-content: center;
	flex-shrink: 0;
}
.table--border .check-box-container {
    box-shadow: inset calc(-1px / var(--dpr)) 0 0 var(--color-border);
}

.sort-button,
.filter-button {
	display: flex;
	flex-direction: column;
	cursor: pointer;
	color: var(--color-info-400);
	align-items: center;
	position: relative;
}

/* 列宽拖动手柄 */
.resize-handle {
	position: absolute;
	top: 0;
	right: 0; // 向右偏移，使其中心对准边框线
	width: 5px; // 稍微加宽感应区域
	height: 100%;
	cursor: col-resize;
	background-color: transparent;
}

.resize-guide-line {
	position: absolute;
	top: 0;
	left: 0;
	border-left: var(--border);	
	z-index: 999; // 确保在最上层，不被遮挡
	pointer-events: none; // 不影响鼠标事件
}

// 筛选下拉框
.filter-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 1000;
	background-color: var(--color-fill);
	border: var(--border);
	border-radius: var(--border-radius);
	padding: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-keyword {
	padding: 6px 8px 4px 8px;
}

.filter-options {
	display: flex;
	flex-direction: column;

	:global(.filter-checkbox-group) {
		gap: 0;
		flex-direction: column;
		margin-left: 1rem;

		:global(.filter-checkbox-hidden) {
			display: none;
		}
	}

	.filter-checkbox-select-all {
		display: flex;
		align-items: center;
		gap: 4px;
	}

	.filter-checkbox-group-container {
		max-height: 200px;
		overflow-y: auto;
	}
}

.filter-actions {
	padding: 0 10px;
	display: flex;
	justify-content: space-between;
}

.is-active {
	color: var(--color-primary-600);
}

.sort-index {
	scale: 0.9;
	color: var(--color-primary-600);
	position: absolute;
	right: -4px;
	bottom: 0;
}